import request from '@/utils/request'

// 查询合同信息列表
export function listContract(query) {
  return request({
    url: '/contract/contract/list',
    method: 'get',
    params: query
  })
}

// 查询合同信息详细
export function getContract(id) {
  return request({
    url: '/contract/contract/' + id,
    method: 'get'
  })
}

// 新增合同信息
export function addContract(data) {
  return request({
    url: '/contract/contract',
    method: 'post',
    data: data
  })
}

// 上传文件
export function minIoUploadFile(data) {
  return request({
    url: '/common/minio/upload',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    data: data
  })
}

// 修改合同信息
export function updateContract(data) {
  return request({
    url: '/contract/contract',
    method: 'put',
    data: data
  })
}

// 删除合同信息
export function delContract(id) {
  return request({
    url: '/contract/contract/' + id,
    method: 'put',
  })
}

// 审核通过
export function passContract(id) {
  return request({
    url: '/contract/contract/pass/' + id,
    method: 'get'
  })
}
// 审核通过
export function rejectContract(id) {
  return request({
    url: '/contract/contract/reject/' + id,
    method: 'get'
  })
}

// 盖章
export function stampContract(id) {
  return request({
    url: '/contract/contract/stamp/' + id,
    method: 'get'
  })
}

// 查询客户信息列表
export function listCustomer(query) {
  return request({
    url: '/customer/customer/list',
    method: 'get',
    params: query
  })
}